Skip to content

Comments

Hide CLI console window on Windows across all SDKs#329

Merged
SteveSandersonMS merged 5 commits intomainfrom
copilot/add-hide-cli-window-option
Feb 16, 2026
Merged

Hide CLI console window on Windows across all SDKs#329
SteveSandersonMS merged 5 commits intomainfrom
copilot/add-hide-cli-window-option

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

Windows GUI applications show a console window when the SDK auto-starts the CLI subprocess, breaking the user experience for frozen apps.

Changes

All SDKs now automatically hide the console window on Windows when spawning the CLI subprocess:

  • Python: Uses subprocess.CREATE_NO_WINDOW flag unconditionally on Windows
  • Node.js: Uses windowsHide: true in spawn options
  • Go: Uses SysProcAttr.HideWindow via platform-specific build tags
  • .NET: Already had CreateNoWindow = true (no changes needed)

Implementation

Python

Uses conditional kwargs pattern to avoid passing Windows-specific parameters on other platforms:

popen_kwargs = {"cwd": self.options["cwd"], "env": env}

if sys.platform == "win32":
    popen_kwargs["creationflags"] = subprocess.CREATE_NO_WINDOW

self._process = subprocess.Popen(args, **popen_kwargs)

Node.js

this.cliProcess = spawn(command, spawnArgs, {
    stdio: ...,
    cwd: this.options.cwd,
    env: envWithoutNodeDebug,
    windowsHide: true,
});

Go

Platform-specific files with build tags:

  • process_windows.go: Sets SysProcAttr.HideWindow = true
  • process_other.go: No-op on non-Windows platforms

Behavior

The console window is now automatically hidden on Windows across all SDKs, ensuring a consistent user experience in GUI applications. No configuration required.

Original prompt

This section details on the original issue you should resolve

<issue_title>Copilot CLI subprocess opens console window when SDK auto-starts CLI</issue_title>
<issue_description>When using the Python SDK on Windows in a frozen app, a console window pops up and stays open whenever the SDK auto-starts the Copilot CLI server. This happens because the CLI is spawned via subprocess.Popen(...) without CREATE_NO_WINDOW/STARTUPINFO

Relevant lines:
https://github.com/github/copilot-sdk/blob/main/python/copilot/client.py#L927-L935
https://github.com/github/copilot-sdk/blob/main/python/copilot/client.py#L939-L946

The console window is visible and distracts end users. This is especially noticeable in GUI apps that shouldn’t show any terminal windows.

Could you add an option to suppress the window on Windows? For example:

  • A client option like hide_cli_window: true, or
  • Passing creationflags=subprocess.CREATE_NO_WINDOW / startupinfo when launching the CLI on Windows</issue_description>

<agent_instructions>Review the issue and implement the change.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add option to hide console window for Copilot CLI Add hide_cli_window option to suppress console on Windows Feb 2, 2026
Copilot AI requested a review from patniko February 2, 2026 18:07
@SteveSandersonMS
Copy link
Contributor

@copilot This shouldn't be an option. The SDK should always hide the window. Check this is consistent across all the 4 language SDKs.

Copy link
Contributor Author

Copilot AI commented Feb 16, 2026

@copilot This shouldn't be an option. The SDK should always hide the window. Check this is consistent across all the 4 language SDKs.

Done! I've made hiding the CLI window the default behavior across all SDKs:

Python: Removed the hide_cli_window option - now always hides on Windows (586f262)
Node.js: Added windowsHide: true to spawn options (586f262)
Go: Added platform-specific configureProcAttr with HideWindow on Windows (586f262)
.NET: Already had CreateNoWindow = true

All SDKs now consistently hide the console window on Windows to avoid distracting users in GUI apps.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/copilot_internal/user
    • Triggering command: /opt/hostedtoolcache/node/22.22.0/x64/bin/node node /home/REDACTED/work/copilot-sdk/copilot-sdk/nodejs/node_modules/@github/copilot/index.js --server --log-level info --stdio _cgo_.o (http block)
    • Triggering command: /opt/hostedtoolcache/node/22.22.0/x64/bin/node node /home/REDACTED/work/copilot-sdk/copilot-sdk/nodejs/node_modules/@github/copilot/index.js --server --log-level info --stdio e.go ux_amd64/compile --gdwarf-5 --64 -o ux_amd64/compile 4484�� ache/go/1.24.13/x64/src/net -I ache/just/1.46.0/x64/node --gdwarf-5 --64 -o 4484424/b110/_x0remote (http block)
    • Triggering command: /opt/hostedtoolcache/node/22.22.0/x64/bin/node node /home/REDACTED/work/copilot-sdk/copilot-sdk/nodejs/node_modules/@github/copilot/index.js --server --log-level info --stdio -I ux_amd64/vet --gdwarf-5 li_window option-1 ut-2373211685.c ux_amd64/vet -qui�� lotsdk-nodejs.ts /tmp/go-build1154484424/b110/ x64/pkg/tool/linux_amd64/vet . -imultiarch x86_64-linux-gnu x64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/user
    • Triggering command: /opt/hostedtoolcache/node/22.22.0/x64/bin/node node /home/REDACTED/work/copilot-sdk/copilot-sdk/nodejs/node_modules/@github/copilot/index.js --server --log-level info --stdio t-estree/dist/simple-traverse.d.ts t-estree/dist/ts-estree/index.d.ts t-estree/dist/tsgrep t-estree/dist/ts-l t-estree/dist/noSysProcAttr\|HideWindow t-estree/dist/clgo/e2e/testharness/proxy.go t-es�� t-estree/dist/semantic-or-syntactic-errors.d.ts t-estree/dist/use-at-your-own-risk.d.ts t-estree/dist/version.d.ts t-estree/dist/usbash t-estree/dist/ve--norc t-estree/dist/so--noprofile t-estree/dist/create-program/valgo/jsonrpc.go (http block)
    • Triggering command: `/opt/hostedtoolcache/node/22.22.0/x64/bin/node node /home/REDACTED/work/copilot-sdk/copilot-sdk/nodejs/node_modules/@github/copilot/index.js --server --log-level info --stdio indow on Windows (removed hide_cli_window option)
  • Node.js: Add windowsHide: true to spawn options
  • Go: Add SysProcAttr with HideWindow on Windows via platform-specific file x64/pkg/tool/lin-o` (http block)
  • Triggering command: /opt/hostedtoolcache/node/22.22.0/x64/bin/node node /home/REDACTED/work/copilot-sdk/copilot-sdk/nodejs/node_modules/@github/copilot/index.js --server --log-level info --stdio go/e2e/testharness/helper.go ache/go/1.24.13/x64/pkg/tool/lin-o (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add hide_cli_window option to suppress console on Windows Hide CLI console window on Windows across all SDKs Feb 16, 2026
Copilot AI and others added 4 commits February 16, 2026 16:57
Co-authored-by: patniko <26906478+patniko@users.noreply.github.com>
…sertions

Co-authored-by: patniko <26906478+patniko@users.noreply.github.com>
- Python: Always hide window on Windows (removed hide_cli_window option)
- Node.js: Add windowsHide: true to spawn options
- Go: Add SysProcAttr with HideWindow on Windows via platform-specific files
- .NET: Already had CreateNoWindow = true

This ensures consistent behavior across all SDKs where the CLI subprocess
console window is hidden on Windows to avoid distracting users in GUI apps.

Co-authored-by: SteveSandersonMS <1101362+SteveSandersonMS@users.noreply.github.com>
@SteveSandersonMS SteveSandersonMS force-pushed the copilot/add-hide-cli-window-option branch 2 times, most recently from 4ed5407 to 294789f Compare February 16, 2026 17:01
@SteveSandersonMS SteveSandersonMS force-pushed the copilot/add-hide-cli-window-option branch from 294789f to c89912f Compare February 16, 2026 17:02
@SteveSandersonMS SteveSandersonMS marked this pull request as ready for review February 16, 2026 17:04
@SteveSandersonMS SteveSandersonMS requested a review from a team as a code owner February 16, 2026 17:04
Copilot AI review requested due to automatic review settings February 16, 2026 17:04
@SteveSandersonMS SteveSandersonMS merged commit f1038d7 into main Feb 16, 2026
30 checks passed
@SteveSandersonMS SteveSandersonMS deleted the copilot/add-hide-cli-window-option branch February 16, 2026 17:05
@github-actions
Copy link

✅ Cross-SDK Consistency Review

This PR maintains excellent cross-SDK consistency by implementing the same feature (hiding CLI console window on Windows) across all four SDK implementations.

Implementation Summary

All SDKs now automatically hide the console window on Windows when spawning the CLI subprocess:

SDK Implementation Mechanism
Python ✅ Added subprocess.CREATE_NO_WINDOW (conditional on sys.platform == "win32")
Node.js ✅ Added windowsHide: true in spawn options
Go ✅ Added SysProcAttr.HideWindow = true (platform-specific with build tags)
.NET ✅ Already present CreateNoWindow = true (no changes needed)

Why This Is Well Done

  1. Feature parity: All four SDKs now provide the same user experience on Windows
  2. Idiomatic implementations: Each SDK uses the platform-appropriate approach:
    • Python: Runtime platform check with conditional kwargs
    • Node.js: Built-in windowsHide option (cross-platform safe)
    • Go: Build tags for compile-time platform selection
    • .NET: ProcessStartInfo property
  3. No configuration needed: The behavior is automatic and sensible (no user-facing API changes)
  4. Consistent comments: Each implementation includes similar explanatory comments

No Action Required

This PR successfully brings all SDKs into alignment. No additional cross-SDK changes are needed. 🎉

AI generated by SDK Consistency Review Agent

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves Windows GUI/frozen-app UX by ensuring the Copilot CLI subprocess does not pop up a visible console window when auto-started by the SDKs, aligning behavior across Python, Node.js, and Go (with .NET already compliant).

Changes:

  • Python: pass creationflags=subprocess.CREATE_NO_WINDOW on Windows when spawning the CLI.
  • Node.js: add windowsHide: true to the CLI spawn options for both .js and executable CLI paths.
  • Go: introduce platform-specific configureProcAttr helpers to set SysProcAttr.HideWindow = true on Windows and call it from CLI process startup.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
python/copilot/client.py Hides Windows console window via creationflags when spawning the CLI subprocess.
nodejs/src/client.ts Ensures spawned CLI process uses windowsHide: true on Windows.
go/process_windows.go Windows-only helper that sets SysProcAttr.HideWindow on the CLI exec command.
go/process_other.go Non-Windows no-op implementation of the process attribute helper.
go/client.go Calls the platform-specific helper before starting the CLI process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copilot CLI subprocess opens console window when SDK auto-starts CLI

3 participants